/**
 * Copyright(c) Taco Tag/Fukila Orgnization. 2009 All Rights Reserved 
 * FileName: FResource.java 
 * Created by Lance on 2009/4/19 
 */
package org.fukila.core.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import org.apache.commons.lang.builder.ToStringBuilder;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;

/**
 * Purpose:
 * 
 * @author Lance
 * @date 2009/4/19 
 * ------------[ Revision History ]---------- 
 * $Date$ 
 * $Log$
 */
@Entity
public class FResource {
    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)    
    private Long   id;
    private String comments;
    private String Url;
    private Date   modifyDate;
    private Date   createDate;
    private String userAcnt;
    
    public FResource(String comments, String url, String userAcnt) {
        super();
        this.comments = comments;
        this.Url = url;
        this.userAcnt = userAcnt;
    }

    public FResource() {
        super();
    }


    public Long getId() {
        return this.id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getComments() {
        return this.comments;
    }

    public void setComments(String comments) {
        this.comments = comments;
    }

    public String getUrl() {
        return this.Url;
    }

    public void setUrl(String url) {
        this.Url = url;
    }

    public Date getModifyDate() {
        return this.modifyDate;
    }

    public void setModifyDate(Date modifyDate) {
        this.modifyDate = modifyDate;
    }
    
    public Date getCreateDate() {
        return this.createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public String getUserAcnt() {
        return this.userAcnt;
    }

    public void setUserAcnt(String userAcnt) {
        this.userAcnt = userAcnt;
    }




    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((this.Url == null) ? 0 : this.Url.hashCode());
        result = prime * result + ((this.comments == null) ? 0 : this.comments.hashCode());
        result = prime * result + ((this.createDate == null) ? 0 : this.createDate.hashCode());
        result = prime * result + ((this.id == null) ? 0 : this.id.hashCode());
        result = prime * result + ((this.modifyDate == null) ? 0 : this.modifyDate.hashCode());
        result = prime * result + ((this.userAcnt == null) ? 0 : this.userAcnt.hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if ( this == obj )
            return true;
        if ( obj == null )
            return false;
        if ( getClass() != obj.getClass() )
            return false;
        FResource other = (FResource) obj;
        if ( this.Url == null ) {
            if ( other.Url != null )
                return false;
        } else if ( !this.Url.equals(other.Url) )
            return false;
        if ( this.comments == null ) {
            if ( other.comments != null )
                return false;
        } else if ( !this.comments.equals(other.comments) )
            return false;
        if ( this.createDate == null ) {
            if ( other.createDate != null )
                return false;
        } else if ( !this.createDate.equals(other.createDate) )
            return false;
        if ( this.id == null ) {
            if ( other.id != null )
                return false;
        } else if ( !this.id.equals(other.id) )
            return false;
        if ( this.modifyDate == null ) {
            if ( other.modifyDate != null )
                return false;
        } else if ( !this.modifyDate.equals(other.modifyDate) )
            return false;
        if ( this.userAcnt == null ) {
            if ( other.userAcnt != null ) 
                return false;
        } else if ( !this.userAcnt.equals(other.userAcnt) )
            return false;
        return true;
    }

    /**
     * @see java.lang.Object#toString()
     */
    public String toString() {
        return new ToStringBuilder(this).append("userAcnt", this.userAcnt).append("url", this.getUrl()).append(
                "comments", this.comments).append("createDate", this.createDate).append("modifyDate", this.modifyDate)
                .append("id", this.id).toString();
    }

    
}
